package com.travel.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 提问表
 * @TableName questions
 */
@TableName(value ="questions")
@Data
public class Questions implements Serializable {
    /**
     * 问题id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 景点id
     */
    @TableField(value = "attractions_id")
    private Integer attractionsId;

    /**
     * 问题标题
     */
    @TableField(value = "questions_title")
    private String questionsTitle;

    /**
     * 问题图片
     */
    @TableField(value = "questions_images")
    private String questionsImages;

    /**
     * 问题描述
     */
    @TableField(value = "questions_desc")
    private String questionsDesc;

    /**
     * 问题标签
     */
    @TableField(value = "questions_lable")
    private String questionsLable;

    /**
     * 用户id
     */
    @TableField(value = "userId")
    private String userid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Questions other = (Questions) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getAttractionsId() == null ? other.getAttractionsId() == null : this.getAttractionsId().equals(other.getAttractionsId()))
            && (this.getQuestionsTitle() == null ? other.getQuestionsTitle() == null : this.getQuestionsTitle().equals(other.getQuestionsTitle()))
            && (this.getQuestionsImages() == null ? other.getQuestionsImages() == null : this.getQuestionsImages().equals(other.getQuestionsImages()))
            && (this.getQuestionsDesc() == null ? other.getQuestionsDesc() == null : this.getQuestionsDesc().equals(other.getQuestionsDesc()))
            && (this.getQuestionsLable() == null ? other.getQuestionsLable() == null : this.getQuestionsLable().equals(other.getQuestionsLable()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getAttractionsId() == null) ? 0 : getAttractionsId().hashCode());
        result = prime * result + ((getQuestionsTitle() == null) ? 0 : getQuestionsTitle().hashCode());
        result = prime * result + ((getQuestionsImages() == null) ? 0 : getQuestionsImages().hashCode());
        result = prime * result + ((getQuestionsDesc() == null) ? 0 : getQuestionsDesc().hashCode());
        result = prime * result + ((getQuestionsLable() == null) ? 0 : getQuestionsLable().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", attractionsId=").append(attractionsId);
        sb.append(", questionsTitle=").append(questionsTitle);
        sb.append(", questionsImages=").append(questionsImages);
        sb.append(", questionsDesc=").append(questionsDesc);
        sb.append(", questionsLable=").append(questionsLable);
        sb.append(", userid=").append(userid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}